﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace RockBus.DataContracts
{
    [DataContract(Namespace = StringConstants.RockBusNamespace)]
    public class PipelineComponentInfo
    {
        private PipelineComponentInfo()
        {
        }

        public PipelineComponentInfo(string id, string typeName, bool active, string soapActionFilter, IEnumerable<KeyValuePair<string, string>> configuration)
            : this()
        {
            this.Id = id;
            this.TypeName = typeName;
            this.Active = active;
            this.SoapActionFilter = soapActionFilter;

            if (configuration != null)
            {
                this.Configuration = new List<KeyValuePair<string, string>>(configuration);
            }
        }

        [DataMember]
        public string Id { get; private set; }

        [DataMember]
        public string TypeName { get; private set; }

        [DataMember]
        public bool Active { get; private set; }

        [DataMember]
        public string SoapActionFilter { get; private set; }

        [DataMember]
        public IEnumerable<KeyValuePair<string, string>> Configuration { get; private set; }
    }
}